package com.explorati.design_pattern.behavior.interpreter;

import org.springframework.expression.Expression;
import org.springframework.expression.spel.standard.SpelExpressionParser;

public class Test {

	public static void main(String[] args) {
//		String exploratiInputStr = "6 100 11 + *";
//		ExploratiExpressionParser expressionParser = new ExploratiExpressionParser();
//		int result = expressionParser.parse(exploratiInputStr);
//		System.out.println("解释器计算结果：" + result);
		
		org.springframework.expression.ExpressionParser parser = new SpelExpressionParser();
		Expression expression = parser.parseExpression("100 *  2 + 400 * 1 + 66");
		int result = (int) expression.getValue();
		System.out.println(result);
	}
}
